diff --git a/user_guide/nav/moo.fx.pack.js b/user_guide/nav/moo.fx.pack.js
index 8b42283..b5c360c 100755
--- a/user_guide/nav/moo.fx.pack.js
+++ b/user_guide/nav/moo.fx.pack.js
@@ -24,7 +24,7 @@
 fx.Resize = Class.create();
 fx.Resize.prototype = {
 	initialize: function(el, options) {
-		this.h = new fx.Height(el, options); 
+		this.h = new fx.Height(el, options);
 		if (options) options.onComplete = null;
 		this.w = new fx.Width(el, options);
 		this.el = $(el);
@@ -93,8 +93,8 @@
 
 	getElementsFromArray: function(array) {
 		var elements = new Array();
-		for (i=0;i<array.length;i++) { 
-			elements.push($(array[i])); 
+		for (i=0;i<array.length;i++) {
+			elements.push($(array[i]));
 		}
 		return elements;
 	}
diff --git a/user_guide/nav/prototype.lite.js b/user_guide/nav/prototype.lite.js
index f1520e2..e6c3622 100755
--- a/user_guide/nav/prototype.lite.js
+++ b/user_guide/nav/prototype.lite.js
@@ -12,15 +12,15 @@
 
 var Class = {
   create: function() {
-    return function() { 
-      this.initialize.apply(this, arguments);
-    }
+	return function() {
+	  this.initialize.apply(this, arguments);
+	}
   }
 }
 
 Object.extend = function(destination, source) {
   for (property in source) {
-    destination[property] = source[property];
+	destination[property] = source[property];
   }
   return destination;
 }
@@ -28,7 +28,7 @@
 Function.prototype.bind = function(object) {
   var __method = this;
   return function() {
-    return __method.apply(object, arguments);
+	return __method.apply(object, arguments);
   }
 }
 
@@ -36,14 +36,14 @@
   var elements = new Array();
 
   for (var i = 0; i < arguments.length; i++) {
-    var element = arguments[i];
-    if (typeof element == 'string')
-      element = document.getElementById(element);
+	var element = arguments[i];
+	if (typeof element == 'string')
+	  element = document.getElementById(element);
 
-    if (arguments.length == 1) 
-      return element;
+	if (arguments.length == 1)
+	  return element;
 
-    elements.push(element);
+	elements.push(element);
   }
 
   return elements;
@@ -54,18 +54,18 @@
 document.getElementsByClassName = function(className) {
   var children = document.getElementsByTagName('*') || document.all;
   var elements = new Array();
-  
+
   for (var i = 0; i < children.length; i++) {
-    var child = children[i];
-    var classNames = child.className.split(' ');
-    for (var j = 0; j < classNames.length; j++) {
-      if (classNames[j] == className) {
-        elements.push(child);
-        break;
-      }
-    }
+	var child = children[i];
+	var classNames = child.className.split(' ');
+	for (var j = 0; j < classNames.length; j++) {
+	  if (classNames[j] == className) {
+		elements.push(child);
+		break;
+	  }
+	}
   }
-  
+
   return elements;
 }
 
@@ -77,51 +77,51 @@
 
 Object.extend(Element, {
   remove: function(element) {
-    element = $(element);
-    element.parentNode.removeChild(element);
+	element = $(element);
+	element.parentNode.removeChild(element);
   },
 
   hasClassName: function(element, className) {
-    element = $(element);
-    if (!element)
-      return;
-    var a = element.className.split(' ');
-    for (var i = 0; i < a.length; i++) {
-      if (a[i] == className)
-        return true;
-    }
-    return false;
+	element = $(element);
+	if (!element)
+	  return;
+	var a = element.className.split(' ');
+	for (var i = 0; i < a.length; i++) {
+	  if (a[i] == className)
+		return true;
+	}
+	return false;
   },
 
   addClassName: function(element, className) {
-    element = $(element);
-    Element.removeClassName(element, className);
-    element.className += ' ' + className;
+	element = $(element);
+	Element.removeClassName(element, className);
+	element.className += ' ' + className;
   },
-  
+
   removeClassName: function(element, className) {
-    element = $(element);
-    if (!element)
-      return;
-    var newClassName = '';
-    var a = element.className.split(' ');
-    for (var i = 0; i < a.length; i++) {
-      if (a[i] != className) {
-        if (i > 0)
-          newClassName += ' ';
-        newClassName += a[i];
-      }
-    }
-    element.className = newClassName;
+	element = $(element);
+	if (!element)
+	  return;
+	var newClassName = '';
+	var a = element.className.split(' ');
+	for (var i = 0; i < a.length; i++) {
+	  if (a[i] != className) {
+		if (i > 0)
+		  newClassName += ' ';
+		newClassName += a[i];
+	  }
+	}
+	element.className = newClassName;
   },
-  
+
   // removes whitespace-only text node children
   cleanWhitespace: function(element) {
-    element = $(element);
-    for (var i = 0; i < element.childNodes.length; i++) {
-      var node = element.childNodes[i];
-      if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) 
-        Element.remove(node);
-    }
+	element = $(element);
+	for (var i = 0; i < element.childNodes.length; i++) {
+	  var node = element.childNodes[i];
+	  if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
+		Element.remove(node);
+	}
   }
 });
\ No newline at end of file
